package com.niit.xlztest.repository;



import com.niit.xlztest.bean.Comm;
import com.niit.xlztest.bean.User;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.awt.print.Book;
import java.util.List;


public interface CommRepository extends CrudRepository<Comm, Integer> {
    @Modifying
    @Transactional
    @Query("delete from Comm c where c.comm_id= :comm_id")
    void deleteCommById(Integer comm_id);
    @Query("from Comm bc where bc.book_id = :book_id")
    List<Comm> findCommByid(@Param("book_id") String book_id);
    @Query("from Comm bc where bc.comm_id = :comm_id")
    Comm findCommByCommid(@Param("comm_id") String comm_id);
}
